from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from models import Document

class DocumentAdmin(admin.ModelAdmin):
	fieldsets = (
		(None, {'fields': ('site', 'user', 'document', 'title', 'slug', 
		    'summary',)}),
	    (_(u'Tagging'), {'fields': ('tags',),}),
	    (_(u'Date information'), {'fields': ('pub_date',), 
        	'classes': 'collapse'}),
	    (_(u'Settings'), {'fields': ('publication_status',)}),
		)
	list_display = ('title', 'pub_date', 'site', 'user', 'document', 
		'publication_status',)
   	list_filter = ('pub_date', 'site', 'user', 'publication_status',)
	search_fields = ['title']
	date_hierarchy = ('pub_date')
	prepopulated_fields = {'slug': ('title',)}
	radio_fields = {'publication_status': admin.HORIZONTAL}
		
admin.site.register(Document, DocumentAdmin)